# -*- coding: utf-8 -*-
import gobject
# NOTIFICATION START
import gtk
import desktop
import kiduxPluginCore

class kiduxPluginGtkGui:
    '''Gui class for Kidux Plugin'''
    def __init__(self, controller, msn):
        self.controller = controller
        self.msn = msn
        self.core = kiduxPluginCore.kiduxPluginCore
        self.plugindir = os.path.realpath(os.path.curdir)
                
        #GTK START
        #Set the Glade file
        self.gladefile = self.plugindir+"/KiduxPlugin.glade"
        self.wTree = gtk.glade.XML(self.gladefile)
        self.DlgConfirmContat = self.wTree.get_widget('DlgConfirmContat')
        self.btnConfirmSim = self.wTree.get_widget('btnConfirmSim')
        self.btnConfirmNao = self.wTree.get_widget('btnConfirmNao')
        self.labelConfirm = self.wTree.get_widget('labelConfirm')
        self.DlgBlocked = self.wTree.get_widget('DlgBlocked')
        events = {"on_btnConfirmNao_clicked" : self.closeDlgConfirmContat,
                        "on_btnConfirmSim_clicked" : self.RequestAuth,
                        "on_BtnBlocked_clicked" : self.closeDlgBlocked}
        self.wTree.signal_autoconnect(events)
            # GTK STOP
    def closeDlgConfirmContat(self,  btn):
        self.DlgConfirmContat.hide()

    def RequestAuth(self, btn):
        #TODO: insert requesting functions here
        self.DlgConfirmContat.hide()

    def closeDlgBlocked(self,  btn):
        self.DlgBlocked.hide()

    

